<?php
$className = "CV";
@include_once "installableInterface.inc";
/*
 * All operations concerning a single user
 * are to be handled by the User class.
 */
class CV implements Installable {
    private $db = null;
    /**
     * The minimal constructor expects at least a Database object.
     *
     * @param Database $db
     */
    public function __construct($db) {
        $this->db = $db;
    }

    /**
     * If the table exists it can be dropped in case
     * a reinstallation is neccessary for instance.
     * @param <link identifier> $db is the database handle.
     */
    public function dropTable() {
        $sql = "DROP TABLE IF EXISTS `CV`";
        $rs = $this->db->executeSQL($sql);
    }

    /**
     * Initially creates the table Users when the database is installed.
     * @param <link identifier> $db is the database handle.
     */
    public function createTable() {
        $this->dropTable();
        $sql = "
            CREATE TABLE  `CV` (
              `ID` int(11) NOT NULL AUTO_INCREMENT,
              `parent` varchar(30) CHARACTER SET latin1 COLLATE latin1_general_ci DEFAULT NULL,
              `tableName` varchar(30) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
              `attributeName` text CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
              `vocable` text CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
              `description` text CHARACTER SET latin1 COLLATE latin1_general_ci,
              PRIMARY KEY (`ID`),
              KEY `nameK` (`tableName`,`attributeName`(5)),
              KEY `vocableK` (`vocable`(5))
            ) ENGINE=MyISAM DEFAULT CHARSET=latin1
        ";
        $rs = $this->db->executeSQL($sql);
        if(!$rs)
            return(false);
        return(true);
    }
    public function insertInitialData() {
    }
}
?>
